<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>

</head>

<script type="text/javascript">
$(document).ready(function(){
	$.ajax({
		url:'task/skillCount',
		type:'post',
		dataType:'json',
		success:function(data){
		  $.each(data,function(inx,ele){
			 $("#taskdetail").append("<div class='task_detail'><a href='task.html?taskId="+ele.taskId+"'><div>"
					 +ele.taskName+"</div><div style='display:none;' id='taskid'>"+ele.taskId+"</div><div>"+ele.dubget+"</div><div>"+ele.city+"</div><div>"
				  +ele.projectCycle+"</div><div>"+ele.workModel+"</div></a></div>")
			 
		 })
		
	}
	  
	})
	$(".task_detail").click(function(){
		
	  function   skillf(){  
		var  skill =document.getElementById("skill_show").value;  
	    window.location.href="home.html?skill="+skill; 
			   
	  }
		  
		$.ajax({
		url:'task/skillCreate',
		type:'post',
		dataType:'json',
		data:{"skill":skill},
		success:function(data){
		  $.each(data,function(inx,ele){
			 $("#taskdetail").append("<div class='task_detail'><a href='task.html?taskId="+ele.taskId+"'><div>"
					 +ele.taskName+"</div><div style='display:none;' id='taskid'>"+ele.taskId+"</div><div>"+ele.dubget+"</div><div>"+ele.city+"</div><div>"
				  +ele.projectCycle+"</div><div>"+ele.workModel+"</div></a></div>")
			 
		 })
		
	}
	  
	})
	})
	
	$.ajax({
		url:'skill/skillshow',
		type:'post',
		dataType:'json',
		success:function(data){
			$.each(data,function(inx,ele){
				$(".skill_name").append("<a href='home.html?skill="+ele.skillName+"'>"+ele.skillName+"&nbsp;")
				
			})
		}
		
	})
	
	/* $("#popular").click(function(){
		$.ajax({
			url:'task/skillCount',
			type:'post',
			dataType:'json',
			success:function(data){
			  $.each(data,function(inx,ele){
					  $("#taskdetail").append("<div class='task_detail'><a href='task/skillCount?'><div>"
							  +ele.taskName+"</div><div>"+ele.dubget+"</div><div>"+ele.city+"</div><div>"
							  +ele.projectCycle+"</div><div>"+ele.workModel+"</div></div>")
				  
				 
			 }) 
			
		}
		  
		})
	}) */

	
})
  function   to(){  
        var  getval =document.getElementById("taskid").value;  
        window.location.href="task.html?taskId="+getval; 
      }  


</script>

<body>
   <div id="skill_show">
     <span class="skill_name" onclick="skillf()"></span>
     <span id="new">最新发布</span>
     <span id="popular">最受欢迎</span>
   </div>
   <div id="taskdetail" onclick="to()">
   
   </div>

</body>
</html>